package com.zjut.zs.school.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.util.module.PageModule;
import com.zjut.zs.school.dao.ZsSchool;
import com.zjut.zs.school.dao.ZsSchoolDAO;
import com.zjut.zs.userschool.dao.ZsUserSchool;
import com.zjut.zs.userschool.dao.ZsUserSchoolDAO;


public class ZsSchoolManager {

	@Resource(name = "ZsSchoolDAO")
	private ZsSchoolDAO dao;
	
	public void addData(ZsSchool obj) {	
		dao.save(obj);
	}
	
	public void updateData(ZsSchool obj) {
		dao.update(obj);
	}
	
	public void deleteData(ZsSchool obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<ZsSchool> objlist) {
		for (ZsSchool ZsSchool : objlist) {
			dao.delete(ZsSchool);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order, ZsSchool obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}

	public ZsSchool getData(int objId) {
		return dao.findById(objId);
	}
}
